## Script (Python) "assertRoleHere"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=role, objectBeingEdited
##title=
##
from AccessControl import Unauthorized

user = context.portal_membership.getAuthenticatedMember()

userRoles = user.getRolesInContext(objectBeingEdited)

if not role in userRoles:
    raise Unauthorized, "assertRole failed"
